home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / UTIL / TouchMe 1.1.1.sit / touchMe 1.11 Folder / CW9 PP source / source / CTouchMePref.h < prev    next >
Text File  |  1996-08-08  |  3KB  |  99 lines

  1. // ==================================================
  2. //    CTouchMePref.h
  3. //    Copyright (C) 1996 Mizutori Tetsuya, July 4 1996.
  4. // ==================================================
  5. //    All documents are pretty-printed in Geneva 10-point font.
  6.  
  7. #pragma once
  8.  
  9. #include "LPrefsFile.h"
  10.  
  11.  
  12. typedef enum {
  13.     touchType_CreationDate = 0,
  14.     touchType_ModificationDate,
  15.     touchType_END
  16. } ETouchType;
  17.  
  18.  
  19. typedef enum {
  20.     touchFlag_Current = 0,
  21.     touchFlag_Direct,
  22.     touchFlag_First,
  23.     touchFlag_Second,
  24.     touchFlag_END
  25. } ETouchFlag;
  26.  
  27.  
  28. typedef struct {
  29.     Uint32        version;
  30.     Rect            wframe;
  31.     Int16        sync;
  32.     Int16        reserved_1;
  33.     Int16        enabled[touchType_END];
  34.     Int16        flag[touchType_END];
  35.     Uint32        datetime[touchType_END];
  36. } SPrefRec, *SPrefPtr, **SPrefHandle;
  37.  
  38.  
  39. class    CTouchMePref : public LPrefsFile {
  40.  
  41. public:
  42.                     CTouchMePref();
  43.                     CTouchMePref( ConstStr255Param inFileName );
  44.     virtual             ~CTouchMePref();
  45.  
  46.     // Read and Write preferences data to/from Prefs file using 'SPrefRec'.
  47.     OSErr            LoadPrefData( void );
  48.     OSErr            SavePrefData( void );
  49.  
  50.     // Set and Get preferences data.
  51.     void                SetWindowRect( const Rect & inWindowRect );
  52.     void                GetWindowRect( Rect & outWindowRect );
  53.  
  54.     void                SetSync( const Boolean inStatus );
  55.     Boolean            GetSync( void );
  56.  
  57.     void                SetEnabled( const ETouchType inType, const Boolean inStatus );
  58.     Boolean            GetEnabled( const ETouchType inType );
  59.  
  60.     void                SetFlag( const ETouchType inType, const ETouchFlag inFlag,
  61.                             const Boolean inStatus );
  62.     Boolean            GetFlag( const ETouchType inType, const ETouchFlag inFlag );
  63.  
  64.     void                SetFlagNumb( const ETouchType inType, const ETouchFlag inFlag );
  65.     ETouchFlag            GetFlagNumb( const ETouchType inType );
  66.  
  67.     void                SetDateTime( const ETouchType inType, const unsigned long inValue );
  68.     unsigned long        GetDateTime( const ETouchType inType );
  69.  
  70.     void                SetDateString( const ETouchType inType, const Str255 inDateStr );
  71.     void                GetDateString( const ETouchType inType, Str255 outDateStr );
  72.     void                SetTimeString( const ETouchType inType, const Str255 inTimeStr );
  73.     void                GetTimeString( const ETouchType inType, Str255 outTimeStr );
  74.  
  75. private:
  76.  
  77.     // Transform preferences data to/from 'SPrefRec' record.
  78.     void                TransformStructToMember( void );
  79.     void                TransformMemberToStruct( void );
  80.  
  81.     // Convert DateTime seconds with String
  82.     void                ConvertString2DateTime( const ETouchType inType );
  83.     void                ConvertDateTime2String( const ETouchType inType );
  84.  
  85.  
  86.     unsigned long        mVersion;
  87.     Rect                mWindowRect;
  88.     Boolean            mSync;
  89.     Boolean            mEnabled[ touchType_END ];
  90.     ETouchFlag            mFlag[ touchType_END ];
  91.     unsigned long        mDateTime[ touchType_END ];
  92.     Str63            mDateStr[ touchType_END ];
  93.     Str63            mTimeStr[ touchType_END ];
  94.  
  95.     SPrefRec            mPrefRec;
  96. };
  97.  
  98. // end of definitions
  99.